package com.eightbears.beboy.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.eightbears.beboy.R;
import com.eightbears.beboy.base.util.CommonUtils;
import com.eightbears.beboy.entity.OrderEntity;

public class ValidRecordByDayAdapter extends BaseQuickAdapter<OrderEntity.OrderInfo, BaseViewHolder> {

    public ValidRecordByDayAdapter() {
        super(R.layout.item_valid_record_day, null);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, OrderEntity.OrderInfo orderInfo) {

        Glide.with(mContext).load(orderInfo.getUser().getCover()).crossFade().error(R.mipmap.default_head).
                into((ImageView) baseViewHolder.getView(R.id.iv_user_head));

        baseViewHolder.setText(R.id.tv_nickname, orderInfo.getUser().getNickname())
                .setText(R.id.tv_shop_name, orderInfo.getShop().getTitle() + ":")
                .setText(R.id.tv_order_name, orderInfo.getCoupon().getTitle())
                .setText(R.id.tv_valid_time, CommonUtils.TimeStamp2Date(orderInfo.getVerify_at(), "HH:mm:ss"))
                .setText(R.id.tv_order_money, "¥ " + orderInfo.getOrder().getReceipt_amount());

    }
}
